// 防抖
export const debounce = (fn: Function, delay: number = 200) => {
  let timer: any = null
  return (...args: any[]) => {
    if (timer) {
      clearTimeout(timer)
    }
    timer = setTimeout(() => {
      fn(...args)
    }, delay)
  }
}

export const handleScrollShow = (distance = 0) => {
  // 判断滚动条是否滚动到底部
  return window.scrollY > distance
}
